import React, { Component } from 'react';
import '../styles/ShowGroup.scss'
import { NavBar } from 'antd-mobile'
import * as service from '../api/index'

class ShowGroup extends Component {
    state = {
        showgrouplist: []
    }
    async componentDidMount() {
        let res = await service.showgrouplist()
        // console.log(res.data.list);
        this.setState({ showgrouplist: res.data.list })
    }
    back = () => {
        this.props.history.goBack()
    }
    render() {
        return (
            <div className='showgroup'>
                <NavBar onBack={() => { this.back() }}>演出群</NavBar>
                <div className="showgrouplist">
                    {
                        this.state.showgrouplist.map((item, index) => {
                            return (
                                <div className="item">
                                    <img src={item.pic} alt="" />
                                    <div className="text">
                                        <div className="name">
                                            {item.name}
                                        </div>
                                        <div className="cate_type">
                                            <div className="category">
                                                {item.category}
                                            </div>
                                            <div className="type">
                                                {item.type}
                                            </div>
                                        </div>
                                        <div className="number">
                                            {item.number}
                                        </div>
                                    </div>
                                </div>
                            )
                        })
                    }
                </div>
            </div>
        );
    }
}

export default ShowGroup;